package com.doordu.soa.service.data.utils;


import java.util.Date;

import com.doordu.soa.service.comm.utils.DateUtils;
import com.doordu.soa.service.web.utils.FileOperatorUtils;

/**
 * 上传数据工具类
 * 
 * @ClassName: UploadDataUtils
 * @Description:
 * @author xiaoqun.yi yixq@doordu.com
 * @date 2017年9月6日 下午2:16:46
 * @version V1.0
 */
public class UploadDataUtils {
	public  static String saveDataToFile(String parentPath, String serviceMethod, String jsonData) {
		Date now=new Date();
		String filePath = parentPath + "/" +serviceMethod+"/"+DateUtils.formatDate("yyyyMMdd", now)+"/"+now.getTime()+".json";
		try {
			FileOperatorUtils.newFile(filePath, jsonData.getBytes());
		} catch (Exception e) {
			return null;
		}
		return filePath;
	}
}
